
<%@ include file="/common/taglibs.jsp"%>
<!--分页查询共用的页面-->
<%@ include file="/common/common.jsp"%>
<%@ page language="java" pageEncoding="UTF-8"%>

<script type="text/javascript" src="<%=jsPath%>/jquery/jquery.timers.js"></script><!--定时器-->
<script type="text/javascript" src="<%=jsPath%>/terminalCommand.js"></script><!--终端命令结果查询-->

<script>
	/*
	修改代码：
	1.新定义变量tc2SendQuestion，为命令支持变量
	2.重定义id：
	原：null		现：sendQuestionCommandMsg
	原：null		现：transparentSendBtn
	原：		现：
	*/

	var tc2TransparentSend = new TerminalCommand2();
	var timerName = "transparentSendTimer";
	///////////////////////////////////////////////////////////////


	$().ready(function () {

		tc2TransparentSend.messageDiv = $("#transparentSendCommandMsg");
		tc2TransparentSend.timerName = timerName;
		tc2TransparentSend.commandButton = $("#transparentSendBtn");

		$("#transparentSendEntityForm").validate(); //初始化验证信息

	 Utility.ajaxSubmitForm("transparentSendEntityForm", {
						 success:function(responseText)
						 {
							   var result = responseText;
								if (result.success) {
									 var commandId = result.data; //下发成功后，获取到命令Id
									 console.log(result.message);
									 tc2TransparentSend.startQueryResult(commandId);//命令下发成功,根据命令id,开始尝试获取检索结果
								}
								else {
									$("#transparentSendCommandMsg").html("提交失败! 错误原因：" + (result.message ? result.message : result.Data));
									//停止所有的在$('body')上定时器  
									$('body').stopTime (timerName);  
								  }
						 }
	 });
});
</script>
 <BODY>
	<form id="transparentSendEntityForm" name="transparentSendEntityForm" 
			action='<%=ApplicationPath%>/transparentSend/send.action' method="POST">
				
        <input type="hidden"  name="vehicleId"  id="vehicleId" value="${vehicleId}"/>
  <table width="100%"  class="TableBlock">
					<tbody><tr>
						<td colspan="2" style="font-weight: bold; background: #EFEFEF;" height="25">数据透传
						<span style="color:red;background:blue;">${message}</span>
						</td>
					</tr>
					<tr>
						<td align="right">消息格式
							:</td>
						<td><select id="msgFormat"  style="width: 150px;" name="msgFormat" >
						         <option value="txt">文本</option>
						         <option value="hex">16进制</option>
						   </select></td>
					</tr>
					<tr>
						<td align="right">消息类型:</td>
						<td ><input id="msgType" name="msgType" class="required digits"  value="0" maxlength="16" size="20" >
						</td>
					</tr>
					<tr>
						<td align="right">消息内容:</td>
						<td ><textarea id="msgContent" name="msgContent" class="required"  value="" rows=5 cols=40  >
						 </textarea>
						</td>
					</tr>
					<tr>

						<td colspan=2 align="center">
						   <input id="transparentSendBtn" type="submit" class="sendjson" value="发送">
						   <span id="transparentSendCommandMsg" class="commandMsg"></span></td>
						
					</tr>

				
					
				</tbody></table>
	</form>
 </BODY>
</HTML>
